//
// Created by 喵喵乐 on 2023/4/9.
//

#ifndef CMAKECXX_CAT_H
#define CMAKECXX_CAT_H

#include <iostream>
#include <cstddef>

using namespace std;

class Cat {
public:
    Cat() {
        cout << "Cat()" << endl;
    }

    ~Cat() {
        cout << "~Cat()" << endl;
    }
};

class Dog_1 {
public:
    void *operator new(size_t sz);

    void operator delete(void *p);
};


class UseResource {
    Cat *bp;
    Dog_1 *op;

public:
    UseResource(int count = 1);

    // 发生异常时 ，通常在对象析构函数中释放对象
    ~UseResource();

};


#endif //CMAKECXX_CAT_H
